// component/custom-tab-bar/index.js
Component({
  data: {
    selected: 0,
    color: "#ffffff",
    selectedColor: "#9c6f35",
    list: [{
      pagePath: "/pages/index/index",
      text: "首页"
    },
    {
      pagePath: "/pages/center/upload/upload",
      text: "艺术品上传"
    },
    {
      pagePath: "/pages/shop/shop",
      text: "艺术品交易"
    },
    {
      pagePath: "/pages/center/center",
      text: "我的"
    }],
  },
  lifetimes: {
    attached() {

    },
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({ url })
      this.setData({
        selected: data.index
      })
    }
  }
})